import request from '@/utils/request'
/**
 * 学科简单列表
 * @param { Object } data
 * @returns
 */
export function getSubjectsListApi() {
  return request({
    url: '/subjects/simple',
    method: 'get'
  })
}

/**
 * 目录列表
 * @param { Object } data
 * @returns
 */
export function getDirectoryListApi(subjectID) {
  return request({
    url: '/directorys',
    method: 'get',
    params: {
      subjectID
    }
  })
}

/**
 * 标签列表
 * @param { Object } data
 * @returns
 */
export function getTagsListApi(subjectID) {
  return request({
    url: '/tags',
    method: 'get',
    params: {
      subjectID
    }
  })
}
// 学科列表
export function xuekelist(params) {
  return request({
    url: `/subjects`,
    method: 'get',
    params
  })
}
// 学科添加
export function xuekeadd(data) {
  return request({
    url: `/subjects`,
    method: 'post',
    data
  })
}
// 学科修改
export function xuekexiugai(data) {
  return request({
    url: `/subjects/${data.id}`,
    method: 'put',
    data
  })
}
// 学科删除
export function xuekedel(id) {
  return request({
    url: `/subjects/${id}`,
    method: 'delete'
  })
}
// 目标列表
export function mubiaolist(params) {
  return request({
    url: `/directorys`,
    method: 'get',
    params
  })
}
// 目标状态
export function mubiaolzhuangtai(data) {
  return request({
    url: `/directorys/${data.id}/${data.state}`,
    method: 'post'
  })
}
// 目标添加
export function muluadd(data) {
  return request({
    url: `/directorys`,
    method: 'post',
    data
  })
}
// 目标修改
export function muluxiugai(data) {
  return request({
    url: `/directorys/${data.id}`,
    method: 'put',
    data
  })
}
// 目标删除
export function muludel(id) {
  return request({
    url: `/directorys/${id}`,
    method: 'delete'
  })
}
// 标签列表
export function biaoqianlist(params) {
  return request({
    url: `/tags`,
    method: 'get',
    params
  })
}
// 标签状态
export function bisoqianzhuangtai(data) {
  return request({
    url: `/tags/${data.id}/${data.state}`,
    method: 'post'
  })
}
// 标签添加
export function biaoqianadd(data) {
  return request({
    url: `/tags`,
    method: 'post',
    data
  })
}
// 标签修改
export function biaoqianxiugai(data) {
  return request({
    url: `/tags/${data.id}`,
    method: 'put',
    data
  })
}
// 标签删除
export function biaoqiandel(id) {
  return request({
    url: `/tags/${id}`,
    method: 'delete'
  })
}
// 面试列表
export function wenzhanglist(params) {
  return request({
    url: `/articles`,
    method: 'get',
    params
  })
}
// 面试添加
export function wenzhangadd(data) {
  return request({
    url: `/articles`,
    method: 'post',
    data
  })
}
// 面试修改
export function wenzhangxiugai(data) {
  return request({
    url: `/articles/${data.id}`,
    method: 'put',
    data
  })
}
// 面试状态
export function wenzhangzhuangtai(data) {
  return request({
    url: `/articles/${data.id}/${data.state}`,
    method: 'post'
  })
}
// 标签删除
export function wenzhangdel(id) {
  return request({
    url: `/articles/${id}`,
    method: 'delete'
  })
}
